package com.rjxy.plansystemmanagement.service.impl;

import com.rjxy.plansystemmanagement.entity.OrderInformation;
import com.rjxy.plansystemmanagement.mapper.OrderMapper;
import com.rjxy.plansystemmanagement.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    /**
     * 获取所有订单
     * @return
     */
    @Override
    public List<OrderInformation> list() {
        return orderMapper.list();
    }

    /**
     * 根据id删除指定订单
     * @param id
     */
    @Override
    public void deleteOrder(Integer id) {
        orderMapper.deleteOrder(id);
    }

    /**
     * 增加订单信息
     * @param orderInformation
     */
    @Override
    public void addOrder(OrderInformation orderInformation) {
        orderMapper.addOrder(orderInformation);
    }

    @Override
    public OrderInformation getOrderById(Integer id) {
        return orderMapper.getOrderById(id);
    }

    @Override
    public List<OrderInformation> getOrderByUid(Integer id) {
        return orderMapper.getOrderByUid(id);
    }

    @Override
    public void updateOrder(OrderInformation orderInformation) {
        orderMapper.updateOrder(orderInformation);
    }
}
